package com.view;
import javax.microedition.lcdui.ChoiceGroup;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.ItemStateListener;
import javax.microedition.lcdui.StringItem;
/*
 * BemItem.java
 *
 * Created on 30 de Maio de 2007, 11:19
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author Bruno Araujo
 */
public class BemItem {
    
    public ChoiceGroup chgBem;
    private StringItem stritBem;
    private int cod;
    private GenericForm form;
    public String titulo;
    public String descricao;
    public boolean checked = true;
    
    /** Creates a new instance of BemItem */
    public BemItem(int cod, String titulo, String descricao, GenericForm form) {
        chgBem = new ChoiceGroup(null, ChoiceGroup.MULTIPLE, new String[] {titulo},
                null);
        chgBem.setSelectedFlags(new boolean[] {true});
        stritBem = new StringItem(null, descricao);
        this.form = form;
        this.titulo = titulo;
        this.descricao = descricao;
    }
    
    public void append() {
        form.append(chgBem);
        form.append(stritBem);
    }
    
    public void setChecked(boolean check) {
        this.checked = check;
        chgBem.setSelectedFlags(new boolean[] {check});
    }
       
}
